package com.mzy.basics.utils.Redis;

import org.springframework.util.CollectionUtils;

import java.util.Collection;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * @author Ives
 * * @date 2022/1/14
 */
public class deleteByPrefox {
  /**
   * 判断是否包含该前缀的key 存在 则删除
   * @param prefixKey
   */
//  public void delByPrefixKey(String prefixKey){
//    Set<String> keyList = redisCacheService.getPrefixKeys(prefixKey);
//    if (!CollectionUtils.isEmpty(keyList)) {
//      redisCacheService.delAll(keyList);
//    }
//  }
//
//
//  public void delAll(Collection<String> keys) {
//    Collection<String> primaryKeys = (Collection)keys.stream().map((k) -> {
//      return this.getUkPrfex(k);
//    }).collect(Collectors.toList());
//    this.redisTemplate.delete(primaryKeys);
//  }
}
